{% extends "base.html" %}

{% block title %}Posted Data{% endblock %}

{% block content %}
<div class="post">
    <h1 class="title">Posted data</h1>
    <div class="entry">
        {% if multiple_formsets %}
        <p>Received data from {{ data|length }} formsets.</p>
        {% for formset_data in data %}
        <h2>Formset #{{ forloop.counter }}</h2>
        {% for form_data in formset_data %}
        <p>
            <strong>Form #{{ forloop.counter }}</strong><br />
            {% for row in form_data.items %}
            <strong>{{ row.0 }}:</strong> {{ row.1 }}{% if not forloop.last %}<br />{% endif %}
            {% endfor %}
        </p>
        {% endfor%}
        {% endfor %}
        {% else %}
        <p>Received data from {{ data|length }} forms.</p>
        {% for form_data in data %}
        <p>
            <strong>Form #{{ forloop.counter }}</strong><br />
            {% for row in form_data.items %}
            <strong>{{ row.0 }}:</strong> {{ row.1 }}{% if not forloop.last %}<br />{% endif %}
            {% endfor %}
        </p>
        {% endfor %}
        {% endif %}
    </div>
</div>
{% endblock %}
